package test;

import java.util.HashSet;
import java.util.Objects;
import java.util.Scanner;

public class Main {
    class Student {
        String id;
        String name;
        int age;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Student student = (Student) o;
            return id.equals(student.id);
        }

        @Override
        public int hashCode() {
            return Objects.hash(id);
        }

        @Override
        public String toString() {
            return id + ":" + name + ":" + age + "岁";
        }
    }

    public void test() {
        HashSet<Student> set = new HashSet<>();
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 4; i++) {
            String id = sc.next();
            String name = sc.next();
            int age = sc.nextInt();
            Student student = new Student();
            student.setAge(age);
            student.setName(name);
            student.setId(id);
            set.add(student);
        }

        for (Student student : set) {
            System.out.println(student);
        }


    }


    public static void main(String[] args) {
        Thread thread = Thread.currentThread();
        new Main().test();
    }

}